from pcb import PCB, PCBLabel
import random


def getPcbs():
    pcbList = []
    pcbLabelList = []
    n = 5
    for i in range(n):
        # 实例化pcb
        pcb = PCB("pcb {}".format(i+1), random.randint(1, n), i, random.randint(2*n, 3*n))
        pcbList.append(pcb)

        # 实例化pcb的图标
        pcbLabel = PCBLabel(pcb, [90 + i*130, 50])
        pcbLabelList.append(pcbLabel)
    return pcbList, pcbLabelList
#
# for i in pcbList:
#     print(i.__repr__)
# print("-"*30)


# while len(pcbList):
#     p = pcbList.pop(0)
#     p.dorun(2)
#     if p.state != 'F':
#         pcbList.append(p)
#     for i in pcbList:
#         print(i.__repr__)
#     print("*"*10)